/* 
 * File:   Visualization.cpp
 * Author: cjjonker
 * 
 * Created on 20 december 2012, 15:03
 */

#include "Visualization.h"

Visualization::Visualization() 
{
    // ORDER MATTERS HERE!!! They are drawn on top of eachother. Last one is on top.
    d_visualizers = {&d_smoke, &d_glyphs};
}


void Visualization::setSimulation(Simulation* sim)
{
    d_simulation = sim;
    for (auto it = d_visualizers.begin(); it != d_visualizers.end(); ++it)
    {
        (*it)->setSimulation(sim);
        (*it)->setCurrentMapDataset();
    }
    
}

void Visualization::visualize(int winW, int winH)
{
//    for (int v = 0; v<d_visualizers.size(); v++)
//    {
//        if (d_visualizers.at(v)->isActive())
//        {
//            d_visualizers.at(v)->draw(winW, winH);
//        }
//    }
    for (auto it = d_visualizers.begin(); it != d_visualizers.end(); ++it)
    {
        if ((*it)->isActive())
            (*it)->draw(winW, winH);
    }
}

